package com.ruoyi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.RuoyiClassMapper;
import com.ruoyi.domain.RuoyiClass;
import com.ruoyi.service.IRuoyiClassService;

/**
 * 班级Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-31
 */
@Service
public class RuoyiClassServiceImpl implements IRuoyiClassService 
{
    @Autowired
    private RuoyiClassMapper ruoyiClassMapper;

    /**
     * 查询班级
     * 
     * @param clId 班级主键
     * @return 班级
     */
    @Override
    public RuoyiClass selectRuoyiClassByClId(Long clId)
    {
        return ruoyiClassMapper.selectRuoyiClassByClId(clId);
    }

    /**
     * 查询班级列表
     * 
     * @param ruoyiClass 班级
     * @return 班级
     */
    @Override
    public List<RuoyiClass> selectRuoyiClassList(RuoyiClass ruoyiClass)
    {
        return ruoyiClassMapper.selectRuoyiClassList(ruoyiClass);
    }

    /**
     * 新增班级
     * 
     * @param ruoyiClass 班级
     * @return 结果
     */
    @Override
    public int insertRuoyiClass(RuoyiClass ruoyiClass)
    {
        ruoyiClass.setCreateTime(DateUtils.getNowDate());
        return ruoyiClassMapper.insertRuoyiClass(ruoyiClass);
    }

    /**
     * 修改班级
     * 
     * @param ruoyiClass 班级
     * @return 结果
     */
    @Override
    public int updateRuoyiClass(RuoyiClass ruoyiClass)
    {
        ruoyiClass.setUpdateTime(DateUtils.getNowDate());
        return ruoyiClassMapper.updateRuoyiClass(ruoyiClass);
    }

    /**
     * 批量删除班级
     * 
     * @param clIds 需要删除的班级主键
     * @return 结果
     */
    @Override
    public int deleteRuoyiClassByClIds(Long[] clIds)
    {
        return ruoyiClassMapper.deleteRuoyiClassByClIds(clIds);
    }

    /**
     * 删除班级信息
     * 
     * @param clId 班级主键
     * @return 结果
     */
    @Override
    public int deleteRuoyiClassByClId(Long clId)
    {
        return ruoyiClassMapper.deleteRuoyiClassByClId(clId);
    }
}
